<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://www.shitou.com" %>
<%@ include file="base.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta content="text/html; charset=GBK" http-equiv="Content-Type" />
	<title>主页面</title>
	<link rel="stylesheet" type="text/css" href="${basePath}/style/reset.css" media="all" />
	<link rel="stylesheet" type="text/css" href="${basePath}/style/layout.css" media="all" />
	<link rel="stylesheet" type="text/css" href="${basePath}/style/invalid.css" media="all" />
	<link rel="stylesheet" type="text/css" href="${basePath}/style/style.css" media="all" />
	<script type="text/javascript" src="${basePath}/script/jquery-1.4.3.min.js"></script>
	<script type="text/javascript" src="${basePath}/script/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="${basePath}/script/jquery.tipTip.minified.js"></script>
	<script type="text/javascript" src="${basePath}/script/simpla.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#subbutton").click(function(){
				var content = $("#newactivity").val();
				if(content.trim().length == 0) {
					$("#notifyMessage div").html("请输入内容后发表！").parent().slideDown().show().fadeTo(400,1);
				} else {
					$("#newsform").submit();
				}
			});
		});
	</script>
</head>
<body>
	<div id="body-wrapper"> 
		<%@ include file="left.jsp" %>
		<!-- main-content开始 -->
		<div id="main-content">
			<!-- main-content-left开始 -->
			<div id="main-content-left">
				<!-- 发表新话题开始 -->
				<div class="content-box">
					<div class="content-box-newactivity clearfix">
						<div id="notifyMessage" class="notification attention png_bg" style="opacity: 0; display: none;">
							<a class="close" href="#">
								<img alt="close" title="Close this notification" src="${basePath }/images/cross_grey_small.png"/>
							</a>
							<div>
							</div>
						</div>
						<form id="newsform" action="index!save.jspx" method="post">
							<input type="hidden" name="news.type" value="1" />
							<label for="newactivity">最新动态</label>
							<textarea name="news.content" id="newactivity"></textarea>
							<div>
								<input id="subbutton" type="button" value="发表" class="button" />
							</div>
						</form>
					</div>
				</div>
				<!-- 发表新话题结束 -->
				<!-- 最新动态内容开始 -->
				<c:forEach items="${newsList}" var="news">
				<div class="activity-item">
					<div class="gra">
						<img class="normal" src="${basePath}/images/default-pic.jpg" alt="avatar" />
					</div>
					<s:news_type type="${news.type}"/>
					${news.content} 
					<p>
						Update by
						<span class="author">
							<a href="${basePath}/user.jspx?id=${news.user.id}" class="plain">${news.user.name}</a>
						</span>
						From
						<span class="date">${news.createdate }</span>
					</p>
				</div>
				</c:forEach>
				<!-- 最新动态内容结束 -->
				<div class="clear"></div>
			</div>
			<!-- mian-content-left结束 -->
			<!-- mian-content-right开始 -->
			<div id="main-content-right">
				<!-- 最新任务处理动态开始 -->
				<div class="content-box">
					<div class="content-box-noheader">
						<c:forEach items="${assignmentList}" var="assignment">
							<div class="user_item">
								<img width="12" height="12" align="absmiddle" src="${basePath}/images/icn_profile.png" alt="Icn_profile" />
								<a href="${basePath }/user.jspx?id=${assignment.user.id}" class="tip" title="${assignment.user.name}">${assignment.user.name}</a>
								正在处理
								<a href="${basePath }/issues.jspx?id=${assignment.issues.id}" class="tip" title="${assignment.issues.title}">${assignment.issues.title}</a>
							</div>
						</c:forEach>
					</div>
				</div>
				<!-- 最新任务处理动态结束 -->
				<!-- 当前用户需任务处理开始 -->
				<div class="content-box">
					<div class="content-box-noheader">
						<h3><a href="${basePath }/user.jspx?id=${sessionScope.user.id}">${sessionScope.user.name}</a>，您有<s:list_size list="${userAssignmentList}"/>个任务需要处理</h3>
						<ul>
							<c:forEach items="${userAssignmentList}" var="assignment">
								<li>
									<a href="${basePath }/issues.jspx?id=${assignment.issues.id}">${assignment.issues.title}</a>
								</li>
							</c:forEach>
						</ul>
					</div>
				</div>
				<!-- 当前用户需任务处理结束 -->
			</div>
			<!-- mian-content-right结束 -->
			<div class="clear"></div>
			<%@include file="foot.jsp" %>
		</div>
		<!-- main-content结束 -->
		
	</div>
</body>
</html>